<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace Rtgm\ecc;

class Sm2Curve
{
    private $adapter;
    const NAME_PSM2 = "SM2";
    public function __construct(\Mdanter\Ecc\Math\GmpMathInterface $adapter)
    {
        $this->adapter = $adapter;
    }
    public function curveSm2($NamedCurveFp)
    {
        $p = gmp_init("0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", 16);
        $b = gmp_init("0x28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", 16);
        $a = gmp_init("0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", 16);
        $parameters = new \Mdanter\Ecc\Primitives\CurveParameters(256, $p, $a, $b);
        return new \Mdanter\Ecc\Curves\NamedCurveFp(self::NAME_PSM2, $parameters, $this->adapter);
    }
    public function generatorSm2($GeneratorPoint, $randomGenerator)
    {
        $curve = $this->curveSm2();
        $order = gmp_init("0xFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", 16);
        $x = gmp_init("0x32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7", 16);
        $y = gmp_init("0xBC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0", 16);
        return $curve->getGenerator($x, $y, $order, $randomGenerator);
    }
}

?>